﻿

Imports System.IO
Public Class frmReconnaissance
    Private m_rowsCount As Integer = 0
    Private m_UpMetData As New UpMetData
    Private m_L As Integer = 0
    Private m_mtierCount As Integer = 0
    Private m_newTierCountSum As Integer = 0
    Private m_k As Integer = 0
    Private count As Integer = 0
    Private m_starttime As String = ""
    Private m_endtime As String = ""
    Private m_TitleChange As Integer = 0
    Private m_Flexchange As Boolean = False
    Private m_CheckStr As Boolean = False
    'Private FileUpperAirCommunication As New FileUpperAirCommunication
    Private m_reconnaissanceCount As Integer = 0
    Private m_type As Boolean = False
    Property Type() As Boolean
        Get
            Return Me.m_type

        End Get
        Set(ByVal value As Boolean)
            Me.m_type = value
        End Set
    End Property
    ''' <summary>
    ''' TD6201格式 结构类
    ''' </summary>
    ''' <remarks></remarks>
    Private m_StructureUpAir(-1) As StructureUpAir
    ''' <summary>
    ''' TD6201格式 结构类
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ArrStructureUpAir() As StructureUpAir()
        Get
            Return Me.m_StructureUpAir
        End Get
        Set(ByVal value As StructureUpAir())
            Me.m_StructureUpAir = value
        End Set
    End Property
    Property CheckStr() As Boolean
        Get
            Return m_CheckStr
        End Get
        Set(ByVal value As Boolean)
            m_CheckStr = value
        End Set
    End Property

    '高空气象数据类
    Public Property UpMetData() As UpMetData
        Get
            Return Me.m_UpMetData
        End Get
        Set(ByVal value As UpMetData)
            Me.m_UpMetData = value
        End Set
    End Property



    
    ''' <summary>
    ''' 把数据在表格中显示出来
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub ShowFlexTimeTier()
        Dim Index As Integer = 0
        'Dim o As Integer = Me.FlexTimeTier.RowSel
        Me.FlexParticularData.Rows.Count = 1
        Me.FlexTimeTier.Rows.Count = Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length + 1
        Dim rdate As String = ""
        Me.FlexParticularData.Cols(5).Caption = "露点温度" & vbCrLf & "[°C]"
        Me.FlexParticularData.Cols(3).Caption = "离地高度" & vbCrLf & "[m]"

        For f1 As Integer = 0 To Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1
            Me.FlexTimeTier.SetData(f1 + 1, 0, f1 + 1)
            rdate = ""
            rdate = Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Year & "-"
            rdate += Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Month & "-"
            rdate += Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Day
            If rdate = "--" Then
                Me.FlexTimeTier.SetData(f1 + 1, 1, "")
            Else
                Me.FlexTimeTier.SetData(f1 + 1, 1, rdate)
            End If
            If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Time = Nothing Then
                Me.FlexTimeTier.SetData(f1 + 1, 2, "")
            Else
                Me.FlexTimeTier.SetData(f1 + 1, 2, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Time)
            End If
            Me.FlexTimeTier.SetData(f1 + 1, 2, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).Time)
            If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).TierCount = Nothing Then
                Me.FlexTimeTier.SetData(f1 + 1, 3, "")

            Else
                Me.FlexTimeTier.SetData(f1 + 1, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).TierCount)

            End If
            If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).TierCount = Nothing Then
                Me.FlexTimeTier.SetData(f1 + 1, 3, 0)

            Else
                Dim aaaa As String = Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).TierCount
                Me.FlexTimeTier.SetData(f1 + 1, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1).TierCount)

            End If

            Me.FlexTimeTier.SetData(f1 + 1, 4, "查看")

        Next



        If m_TitleChange > 0 Then

            Index = Me.m_TitleChange - 1
        Else
            Index = 0
        End If
        If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).TierCount > 0 Then
            Me.FlexParticularData.Rows.Count = Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData.Length + 1
            For f2 As Integer = 0 To Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData.Length - 1


                Me.FlexParticularData.SetData(f2 + 1, 0, f2 + 1)
                Me.FlexParticularData.SetData(f2 + 1, 1, f2 + 1)
                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).Pa = 99999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 2, "")

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).Pa <> 99999 Then

                    Me.FlexParticularData.SetData(f2 + 1, 2, UnitsTranslate.MZ_FormatPa(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).Pa))

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).Pa = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 2, "")


                End If


                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DistanceTerraHeight = -99999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 3, "")

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DistanceTerraHeight <> -99999 Then

                    Me.FlexParticularData.SetData(f2 + 1, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DistanceTerraHeight)


                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DistanceTerraHeight = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 3, "")



                End If


                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DryTemperature = -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DryTemperature <> -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, UnitsTranslate.M_FormatDryTemperature(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DryTemperature))


                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DryTemperature = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                End If


                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DewPointTemperature = -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 5, "")

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DewPointTemperature <> -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 5, UnitsTranslate.M_FormatDewPointTemperature(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DewPointTemperature))


                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).DewPointTemperature = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 5, "")

                End If


                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindVane = 999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, "")

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindVane <> 999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindVane)

                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindVane = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, "")


                End If


                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindSpeed = 9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, "")

                ElseIf UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindSpeed) <> 9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindSpeed))


                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(Index).ArrtierData(f2).WindSpeed = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, "")

                End If
            Next
        End If

        Me.FlexTimeTier.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexTimeTier.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
        Me.FlexTimeTier.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexTimeTier.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None

        Me.FlexParticularData.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexParticularData.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
        Me.FlexParticularData.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexParticularData.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None
    End Sub
    Private Sub ShowUa()
        Me.FlexParticularData.Rows.Count = 1
        Me.FlexParticularData.Cols(3).Caption = "海拔高度" & vbCrLf & "[m]"
        Me.FlexParticularData.SetData(0, 5, "相对湿度" & vbCrLf & "[°C]")
        Me.FlexTimeTier.Rows.Count = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length + 1
        '    Me.FlexParticularData.Rows.Count = Me.FileUpperAirCommunication.ArrStructureUpAir(0).ArrStructureUpAirTierData.Length + 1
        Dim Index As Integer = 0


        For f1 As Integer = 0 To Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1
            Me.FlexTimeTier.SetData(f1 + 1, 0, f1 + 1)




            Me.FlexTimeTier.SetData(f1 + 1, 1, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Day & "日")

            Me.FlexTimeTier.SetData(f1 + 1, 2, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Hour)


            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).TierCount = Nothing Then
                Me.FlexTimeTier.SetData(f1 + 1, 3, "")

            Else
                Me.FlexTimeTier.SetData(f1 + 1, 3, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).TierCount)

            End If


            Me.FlexTimeTier.SetData(f1 + 1, 4, "查看")

        Next



        If m_TitleChange > 0 Then

            Index = Me.m_TitleChange - 1
        Else
            Index = 0
        End If
        If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).TierCount > 0 Then
            Me.FlexParticularData.Rows.Count = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData.Length + 1
            For f2 As Integer = 0 To Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData.Length - 1


                Me.FlexParticularData.SetData(f2 + 1, 0, f2 + 1)
                Me.FlexParticularData.SetData(f2 + 1, 1, f2 + 1)
                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure = 99999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 2, "")

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure <> 99999 Then

                    Me.FlexParticularData.SetData(f2 + 1, 2, UnitsTranslate.MZ_FormatPa(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure))

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 2, "")


                End If


                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height = -99999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 3, "")

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height <> -99999 Then

                    Me.FlexParticularData.SetData(f2 + 1, 3, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height)


                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 3, "")



                End If


                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature = -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature <> -9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, UnitsTranslate.M_FormatDryTemperature(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature))


                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                End If


                
                Me.FlexParticularData.SetData(f2 + 1, 5, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Humidity)




                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane = 999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, "")

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane <> 999 Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane)

                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 6, "")


                End If


                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed = 9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, "")

                ElseIf UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed) <> 9990 Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed) * 10)


                ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed = Nothing Then
                    Me.FlexParticularData.SetData(f2 + 1, 7, "")

                End If
            Next
        End If
       
       

        Me.FlexTimeTier.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexTimeTier.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
        Me.FlexTimeTier.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexTimeTier.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None

        Me.FlexParticularData.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexParticularData.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
        Me.FlexParticularData.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexParticularData.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None
    End Sub
    Private Sub frmReconnaissance_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.FlexParticularData.Styles.Alternate.BackColor = Color.FromArgb(216, 228, 248)
        Me.FlexTimeTier.Styles.Alternate.BackColor = Color.FromArgb(216, 228, 248)



        Me.cobJd.Items.Clear()
        Me.cobWd.Items.Clear()
        '经度

        Me.cobJd.Items.Add("E")
        Me.cobJd.Items.Add("W")
        Me.cobJd.Text = "E"

        '纬度

        Me.cobWd.Items.Add("N")
        Me.cobWd.Items.Add("S")
        Me.cobWd.Text = "N"

        StringHandle.m_openFile = 0
        StringHandle.m_boolTaxis = False

        StringHandle.m_default = False




        Me.FlexParticularData.AutoSizeRows()
        m_rowsCount = 1


        Me.FlexTimeTier.Rows.Count = 1
        Me.FlexParticularData.Rows.Count = 1

        ShowAllData()

        Me.FlexParticularData.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexParticularData.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexParticularData.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None

        Me.FlexTimeTier.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
        Me.FlexTimeTier.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
        Me.FlexTimeTier.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None
    End Sub

    Public Sub ShowAllData()
        If Me.UpMetData.Type = True Then ' m_type = True Then

            If Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length > 0 Then
                Me.Start_time_p.Text = Me.m_UpMetData.title.StartTime
                Me.End_time_p.Text = Me.m_UpMetData.title.EndTime
                If Me.m_UpMetData.title.Longitude IsNot Nothing AndAlso Me.m_UpMetData.title.Longitude <> "" Then
                    Me.txtLongitude.Text = Me.m_UpMetData.title.Longitude.Remove(Me.m_UpMetData.title.Longitude.Length - 1)
                End If
                If Me.m_UpMetData.title.Longitude.EndsWith("e") Or Me.m_UpMetData.title.Longitude.EndsWith("E") Then
                    cobJd.Text = "E"
                Else
                    cobJd.Text = "W"
                End If

                If Me.m_UpMetData.title.Latitude.EndsWith("N") Or Me.m_UpMetData.title.Latitude.EndsWith("n") Then
                    cobWd.Text = "N"
                Else
                    cobWd.Text = "S"
                End If
                If Me.m_UpMetData.title.Latitude IsNot Nothing AndAlso Me.m_UpMetData.title.Latitude <> "" Then
                    Me.txtLatitude.Text = Me.m_UpMetData.title.Latitude.Remove(Me.m_UpMetData.title.Latitude.Length - 1)
                End If

                Me.txtWeatherID.Text = Me.m_UpMetData.title.WeatherID
                Me.txtTimeZone.Text = Me.m_UpMetData.title.TimeZone
                txtTimeModify.Value = Me.m_UpMetData.title.TimeModify
                Me.txtTerraHeight.Enabled = True
                Me.txtTerraHeight.Text = Me.m_UpMetData.title.TerraHeight
                StringHandle.m_openFile = 1
                StringHandle.m_boolTaxis = True
                StringHandle.m_default = True
                Start_time_p.Text = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Day)
                End_time_p.Text = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Day)

                ShowFlexTimeTier()
            End If


        Else
            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length > 0 Then
                Me.Start_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime
                Me.End_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime
                'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).Longitude <> 0 Then
                '    Me.txtLongitude.Text = Me.FileUpperAirCommunication.ArrStructureUpAir(0).Longitude
                'End If

                Me.txtLongitude.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.Longitude
                cobJd.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.LongitudeCode
                'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).LongitudeCode.EndsWith("e") Or Me.FileUpperAirCommunication.ArrStructureUpAir(0).LongitudeCode.EndsWith("E") Then
                '    cobJd.Text = "E"
                'Else
                '    cobJd.Text = "W"
                'End If
                cobWd.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.LatitudeCode
                'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).LatitudeCode.EndsWith("N") Or Me.FileUpperAirCommunication.ArrStructureUpAir(0).LatitudeCode.EndsWith("n") Then
                '    cobWd.Text = "N"
                'Else
                '    cobWd.Text = "S"
                'End If
                Me.txtLatitude.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.Latitude
                'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).Latitude <> 0 Then
                '    Me.txtLatitude.Text = Me.FileUpperAirCommunication.ArrStructureUpAir(0).Latitude
                'End If

                Me.txtWeatherID.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.StationID
                'Me.txtTimeZone.Text = Me.m_UpMetData.title.TimeZone
                'Me.txtTerraHeight.Text = Me.m_UpMetData.title.TerraHeight
                Me.txtTerraHeight.Text = ""
                Me.txtTerraHeight.Enabled = False
                StringHandle.m_openFile = 1
                StringHandle.m_boolTaxis = True
                StringHandle.m_default = True
                Start_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Day & "日"
                End_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Day & "日"
                ShowUa()
            End If
        End If
        SetLongtitude() '计算时区
    End Sub

    Private Sub FlexTimeTier_AfterEdit(ByVal sender As System.Object, ByVal e As C1.Win.C1FlexGrid.RowColEventArgs) Handles FlexTimeTier.AfterEdit
        m_rowsCount += 1
        Dim sum As Integer = 0
        Dim row As Integer = Me.FlexTimeTier.Row
        Dim col As Integer = Me.FlexTimeTier.Col
        Dim a As Integer = 0
        Dim titerID As Integer = 0
        Try
            If row > 0 Then
                If col = 3 And row >= Me.m_L And row <= Me.m_UpMetData.reconnaissance.CountWeather Then
                    For g As Integer = row To row
                        m_mtierCount = Me.FlexTimeTier.GetData(g, 3)
                    Next
                Else
                    m_mtierCount = 0
                End If
                Dim order As Integer = row - 1
                Dim Result As DialogResult
                Dim rowcolvalue As Integer = 0
                If row <= Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length Then
                    If col = 3 Then
                        If Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount > Me.FlexTimeTier.GetData(row, 3) Then
                            rowcolvalue = Me.FlexTimeTier.GetData(row, 3)
                            Result = MessageBox.Show("这样会发生数据丢失,确定吗?", "提示！", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                            If Result = System.Windows.Forms.DialogResult.Yes Then


                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount = rowcolvalue
                                ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(rowcolvalue - 1)

                                Me.ShowFlexTimeTier()

                            ElseIf Result = System.Windows.Forms.DialogResult.No Then

                                Me.FlexTimeTier.SetData(row, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount)
                            Else
                                MessageBox.Show("非法操作！！！")
                            End If
                        Else
                            If Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount = 0 Then
                                For ra As Integer = 0 To Me.FlexTimeTier.GetData(row, col) - 1
                                    ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(ra)
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(ra) = New ReconnaissanceTiterData

                                Next
                            Else
                                '  Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount = Me.FlexTimeTier.GetData(row, col)
                                For ra As Integer = Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount To Me.FlexTimeTier.GetData(row, col) - 1
                                    ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(ra)
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(ra) = New ReconnaissanceTiterData

                                Next
                            End If
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount = Me.FlexTimeTier.GetData(row, col)

                            Me.ShowFlexTimeTier()
                        End If
                    End If


                Else


                    If col = 3 Then

                        ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(order)
                        Me.m_UpMetData.reconnaissance.ArrReconnaissance(order) = New ReconnaissanceData
                        Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount = Me.FlexTimeTier.GetData(row, 3)
                        For r As Integer = 0 To Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).TierCount - 1
                            ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(r)
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(order).ArrtierData(r) = New ReconnaissanceTiterData
                        Next
                        Dim k As Integer = Me.m_UpMetData.reconnaissance.SumCountTier
                        Me.FlexParticularData.Rows.Count += m_mtierCount
                        For l As Integer = 0 To m_mtierCount - 1
                            titerID += 1

                            Me.FlexParticularData.SetData(k, 0, k)
                            Me.FlexParticularData.SetData(k, 1, titerID)
                            k += 1
                        Next
                        Me.m_UpMetData.reconnaissance.SumCountTier = Me.m_UpMetData.reconnaissance.SumCountTier + m_mtierCount
                        Me.ShowAllData()
                    End If



                End If

                m_newTierCountSum += m_mtierCount
            End If
        Catch ex As Exception
            Me.FlexTimeTier.SetData(row, col, 0)
        End Try
    End Sub

    Private Sub btnSet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        StringHandle.m_default = False

    End Sub

    Private Sub FlexParticularData_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles FlexParticularData.Validating


    End Sub

    Private Sub FlexParticularData_AfterEdit(ByVal sender As System.Object, ByVal e As C1.Win.C1FlexGrid.RowColEventArgs) Handles FlexParticularData.AfterEdit
        Dim fp_row As Integer = 0
        Dim fp_col As Integer = 0
        Dim row As Integer = 0
        Dim col As Integer = 0
        Dim uprow As Integer = 0
        Dim downrow As Integer = 0
        Dim replace As Double = 0
        Dim t_row As Integer = Me.FlexTimeTier.RowSel

        fp_row = Me.FlexParticularData.Row
        fp_col = Me.FlexParticularData.Col
        col = Me.FlexParticularData.Col

        Try

            If fp_row > 0 Then
                For i As Integer = 0 To Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1
                    uprow += Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).TierCount
                    replace = Me.FlexParticularData.GetData(fp_row, fp_col)
                    If uprow > fp_row Then
                        If col = 2 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).Pa = replace * 10
                        ElseIf col = 3 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).DistanceTerraHeight = replace '* 10
                        ElseIf col = 4 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).DryTemperature = replace * 10
                        ElseIf col = 5 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).DewPointTemperature = replace * 10
                        ElseIf col = 6 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).WindVane = replace ' / 10
                        ElseIf col = 7 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(fp_row - downrow - 1).WindSpeed = replace * 10
                        End If


                        Exit For
                    ElseIf uprow = fp_row Then
                        If col = 2 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).Pa = replace * 10
                        ElseIf col = 3 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).DistanceTerraHeight = replace ' / 10
                        ElseIf col = 4 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).DryTemperature = replace * 10
                        ElseIf col = 5 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).DewPointTemperature = replace * 10
                        ElseIf col = 6 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).WindVane = replace ' / 10
                        ElseIf col = 7 Then
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(t_row - 1).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).WindSpeed = replace * 10
                        End If
                        ' Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1).Pa = replace / 10
                        Exit For
                    End If

                    downrow += Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).TierCount
                Next
            End If
        Catch ex As Exception

            Me.FlexParticularData.SetData(fp_row, fp_col, "")
            MessageBox.Show("输入错误，请重新输入 ！！！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub


    Private Sub FlexTimeTier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlexTimeTier.Click
        Dim f1 As Integer = Me.FlexTimeTier.RowSel
        Me.FlexParticularData.Rows.Count = 1
        If StringHandle.m_openFile = 1 Then

            If f1 > 0 Then
                If Me.UpMetData.Type = True Then

                    If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).TierCount > 0 Then
                        For f2 As Integer = 0 To Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData.Length - 1
                            Me.FlexParticularData.Rows.Count = Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData.Length + 1
                            Me.FlexParticularData.SetData(f2 + 1, 0, f2 + 1)

                            Me.FlexParticularData.SetData(f2 + 1, 1, f2 + 1)
                            If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2) IsNot Nothing Then
                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).Pa = 99999 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 2, "")
                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).Pa <> 99999 Then

                                    Me.FlexParticularData.SetData(f2 + 1, 2, UnitsTranslate.MZ_FormatPa(Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).Pa))

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).Pa = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 2, "")
                                End If


                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DistanceTerraHeight = -99999 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 3, "")
                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DistanceTerraHeight <> -99999 Then

                                    Me.FlexParticularData.SetData(f2 + 1, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DistanceTerraHeight)


                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DistanceTerraHeight = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 3, "")
                                End If


                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DryTemperature = -9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DryTemperature <> -9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 4, UnitsTranslate.M_FormatDryTemperature(Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DryTemperature))

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DryTemperature = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 4, "")

                                End If


                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DewPointTemperature = -9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 5, "")

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DewPointTemperature <> -9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 5, UnitsTranslate.M_FormatDewPointTemperature(Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DewPointTemperature))

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).DewPointTemperature = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 5, "")

                                End If

                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindVane = 999 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 6, "")

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindVane <> 999 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 6, Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindVane)

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindVane = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 6, "")

                                End If


                                If Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindSpeed = 9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 7, "")

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindSpeed <> 9990 Then
                                    Me.FlexParticularData.SetData(f2 + 1, 7, UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindSpeed))

                                ElseIf Me.m_UpMetData.reconnaissance.ArrReconnaissance(f1 - 1).ArrtierData(f2).WindSpeed = Nothing Then
                                    Me.FlexParticularData.SetData(f2 + 1, 7, "")
                                End If
                            End If
                        Next
                    End If

                Else
                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).TierCount > 0 Then
                        Me.FlexParticularData.Rows.Count = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData.Length + 1
                        For f2 As Integer = 0 To Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData.Length - 1
                            Me.FlexParticularData.SetData(f2 + 1, 0, f2 + 1)
                            Me.FlexParticularData.SetData(f2 + 1, 1, f2 + 1)
                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Airpressure = 99999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 2, "")

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Airpressure <> 99999 Then

                                Me.FlexParticularData.SetData(f2 + 1, 2, UnitsTranslate.MZ_FormatPa(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Airpressure))

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Airpressure = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 2, "")
                            End If


                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Height = -99999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 3, "")

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Height <> -99999 Then

                                Me.FlexParticularData.SetData(f2 + 1, 3, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Height)
                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Height = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 3, "")
                            End If


                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).AirTemperature = -9990 Then
                                Me.FlexParticularData.SetData(f2 + 1, 4, "")

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).AirTemperature <> -9990 Then
                                Me.FlexParticularData.SetData(f2 + 1, 4, UnitsTranslate.M_FormatDryTemperature(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).AirTemperature))


                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).AirTemperature = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 4, "")
                            End If

                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Humidity = 999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 5, "")

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Humidity <> 999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 5, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Humidity)

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).Humidity = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 5, "")
                            End If


                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindVane = 999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 6, "")

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindVane <> 999 Then
                                Me.FlexParticularData.SetData(f2 + 1, 6, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindVane)

                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindVane = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 6, "")
                            End If


                            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindSpeed = 9990 Then
                                Me.FlexParticularData.SetData(f2 + 1, 7, "")

                            ElseIf UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindSpeed) <> 9990 Then
                                Me.FlexParticularData.SetData(f2 + 1, 7, UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindSpeed))
                            ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1 - 1).ArrStructureUpAirTierData(f2).WindSpeed = Nothing Then
                                Me.FlexParticularData.SetData(f2 + 1, 7, "")
                            End If
                        Next
                    End If
                End If
            End If


        End If
        Me.m_TitleChange = Me.FlexTimeTier.RowSel
    End Sub
    Private Sub OpenFileOQA(ByVal file As String)
        m_reconnaissanceCount = 0
        Me.m_TitleChange = 0
        m_L = 0

        Dim Leg As Integer = 0
        Dim abc As Integer = 0
        Dim count As Integer = 0
        Dim i As Integer = -1
        Dim j As Integer = -23
        Dim sdate As String = "'"
        Dim row As Integer = 1
        Dim p As Integer = 0
        Dim boo As Boolean = False
        Dim name As String = "QAOUT"

        Dim thedate As String = "XDATES"
        Dim Result As DialogResult
        Dim msg As Integer = 0
        Dim msgerror As Boolean = False
        Dim tag As String = "*** EOH: END"
        FileOpen(1, file, OpenMode.Input)

        If file <> "" Then
            Try

                Do Until EOF(1)
                    Dim strline As String = LineInput(1)

                    msg += 1
                    msgerror = True
                    StringHandle.m_default = True
                    StringHandle.m_openFile = 1
                    StringHandle.m_boolTaxis = True
                    count += 1

                    '读取经纬度信息
                    If StringHandle.GetString(strline, 2) = "LOCATION" Then

                        Me.m_UpMetData.title.WeatherID = StringHandle.GetString(strline, 3)
                        Me.m_UpMetData.title.TimeZone = StringHandle.GetString(strline, 6)
                        Me.m_UpMetData.title.TerraHeight = StringHandle.GetString(strline, 7)
                        Me.txtWeatherID.Text = Me.m_UpMetData.title.WeatherID
                        Me.txtTimeZone.Text = Me.m_UpMetData.title.TimeZone
                        Me.txtTerraHeight.Text = Me.m_UpMetData.title.TerraHeight
                        Me.txtLatitude.Enabled = True
                        Me.txtLongitude.Enabled = True
                        Me.cobJd.Enabled = True
                        Me.cobWd.Enabled = True
                        Dim one As String = ""
                        Dim two As String = ""
                        one = StringHandle.GetString(strline, 4)
                        two = StringHandle.GetString(strline, 5)
                        If StringHandle.GetLastlyChar(one) = True Then
                            Me.m_UpMetData.title.Longitude = StringHandle.GetString(strline, 4)

                            Me.txtLongitude.Text = Me.m_UpMetData.title.Longitude.Remove(Me.m_UpMetData.title.Longitude.Length - 1)
                            If Me.m_UpMetData.title.Longitude.EndsWith("e") Or Me.m_UpMetData.title.Longitude.EndsWith("E") Then
                                cobJd.Text = "E"
                            Else
                                cobJd.Text = "W"
                            End If
                        ElseIf StringHandle.GetLastlyChar(one) = False Then
                            Me.m_UpMetData.title.Latitude = StringHandle.GetString(strline, 4)
                            Me.txtLatitude.Text = Me.m_UpMetData.title.Latitude.Remove(Me.m_UpMetData.title.Latitude.Length - 1)
                            If Me.m_UpMetData.title.Latitude.EndsWith("N") Or Me.m_UpMetData.title.Latitude.EndsWith("n") Then
                                cobWd.Text = "N"
                            Else
                                cobWd.Text = "S"
                            End If
                        End If
                        If StringHandle.GetLastlyChar(two) = True Then
                            Me.m_UpMetData.title.Longitude = StringHandle.GetString(strline, 5)
                            Me.txtLongitude.Text = Me.m_UpMetData.title.Longitude.Remove(Me.m_UpMetData.title.Longitude.Length - 1)
                            If Me.m_UpMetData.title.Longitude.EndsWith("e") Or Me.m_UpMetData.title.Longitude.EndsWith("E") Then
                                cobJd.Text = "E"
                            Else
                                cobJd.Text = "W"
                            End If
                        ElseIf StringHandle.GetLastlyChar(two) = False Then
                            Me.m_UpMetData.title.Latitude = StringHandle.GetString(strline, 5)
                            Me.txtLatitude.Text = Me.m_UpMetData.title.Latitude.Remove(Me.m_UpMetData.title.Latitude.Length - 1)
                            If Me.m_UpMetData.title.Latitude.EndsWith("N") Or Me.m_UpMetData.title.Latitude.EndsWith("n") Then
                                cobWd.Text = "N"
                            Else
                                cobWd.Text = "S"
                            End If
                        End If
                    End If
                    Dim fyear As String = ""
                    If strline.Trim().Length > 2 And strline.StartsWith("*") = False Then '如果这行不为空
                        If strline.Length > 10 And strline.Length <= 20 Then
                            i = -1
                            j = -23
                            boo = True
                            ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(p)
                            Me.m_UpMetData.reconnaissance.ArrReconnaissance(p) = New ReconnaissanceData
                            sdate = StringHandle.GetString(strline, 1)
                            If sdate.Length <= 9 Then
                                Dim a As String = StringHandle.GetString(strline, 1).Trim()
                                fyear = StringHandle.GetString(strline, 1).ToString.Remove(2)
                                If fyear >= 50 Then
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Year = 19 & fyear

                                Else
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Year = 20 & fyear
                                End If
                                sdate = StringHandle.GetString(strline, 1)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Month = Mid(sdate, 3, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Day = Mid(sdate, 5, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Time = Mid(sdate, 7, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).TierCount = StringHandle.GetString(strline, 2)
                            Else
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Year = StringHandle.GetString(strline, 1).Remove(4)
                                sdate = StringHandle.GetString(strline, 1)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Month = Mid(sdate, 5, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Day = Mid(sdate, 7, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).Time = Mid(sdate, 9, 2)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).TierCount = StringHandle.GetString(strline, 2)

                            End If
                        Else
                            boo = False
                        End If
                        If boo = False And strline.Length > 14 Then
                            Try '由于评估中心的格式有问题所以这样做
                                i += 1
                                If i = Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).TierCount - 1 Then
                                    j = Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).TierCount
                                End If
                                ReDim Preserve Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i)
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i) = New ReconnaissanceTiterData
                                Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).Titer = i + 1
                                If file.Substring(file.Length - 3, 3).ToUpper = "OQA" Then
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).Pa = CInt(Mid(strline, 1, 7))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DistanceTerraHeight = CInt(Mid(strline, 8, 7))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DryTemperature = CInt(Mid(strline, 15, 7))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DewPointTemperature = CInt(Mid(strline, 22, 7))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).WindVane = CInt(Mid(strline, 29, 7))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).WindSpeed = CInt(Mid(strline, 36, 7))
                                ElseIf file.Substring(file.Length - 3, 3).ToUpper = "TXT" Then
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).Pa = CInt(StringHandle.GetString(strline, 1))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DistanceTerraHeight = CInt(StringHandle.GetString(strline, 2))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DryTemperature = CInt(StringHandle.GetString(strline, 3))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).DewPointTemperature = CInt(StringHandle.GetString(strline, 4))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).WindVane = CInt(StringHandle.GetString(strline, 5))
                                    Me.m_UpMetData.reconnaissance.ArrReconnaissance(p).ArrtierData(i).WindSpeed = CInt(StringHandle.GetString(strline, 6))
                                End If
                            Catch ex As Exception

                            End Try

                        End If
                        If i = j - 1 Then
                            p += 1
                            boo = True
                        End If
                    End If
                Loop
                If msgerror = True Then
                    '
                    Me.m_UpMetData.reconnaissance.CountWeather = p
                    m_L = Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length + 1
                    m_starttime = Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Year & "年" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Month & "月" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Day & "日"
                    m_endtime = Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Year & "年" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Month & "月" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Day & "日"
                    Me.Start_time_p.Text = m_starttime

                    Me.End_time_p.Text = m_endtime

                    ShowFlexTimeTier()

                End If
                FileClose(1)
            Catch ex As Exception
                msgerror = False
                Result = MessageBox.Show("你选择的文件格式不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
                FileClose(1)
            End Try

        End If

    End Sub
    Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
        Try
            Me.UpMetData.Type = True
            m_type = True
            m_reconnaissanceCount = 0

            OpenFileDialog1.Multiselect = True

            Dim Afile As String = ""
            OpenFileDialog1.Filter = "AERMET 高空气象数据文件(*.OQA)|*.OQA|环境评估中心高空气象数据文件(*.TXT)|*.TXT|FSL文件(*.dat)|*.dat|TD6201(*.UA)|*.UA"
            ' OpenFileDialog1.Filter = "AERMET 高空气象数据文件(*.OQA)|*.OQA|环境评估中心高空气象数据文件(*.TXT)|*.TXT|FSL文件(*.dat)|*.dat" '|TD6201(*.UA)|*.UA"
            If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
                Me.m_TitleChange = 0
                Me.FlexTimeTier.Rows.Count = 1
                Me.FlexParticularData.Rows.Count = 1
                mFileName = OpenFileDialog1.FileName
                If OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.Length - 3, 3).ToUpper = "TXT" Then
                    MyObjectClear()
                    ClearTextBox()
                    Dim A(-1) As ReconnaissanceDataConcourse
                    For Each Afile In OpenFileDialog1.FileNames
                        OpenFileOQA(Afile)
                        ReDim Preserve A(A.Length)
                        A(A.Length - 1) = Me.UpMetData.reconnaissance.Clone
                    Next
                    Dim NewReconnaissanceDataConcourse As New ReconnaissanceDataConcourse
                    Dim MinReconnaissanceDataConcourse As New ReconnaissanceDataConcourse
                    MinReconnaissanceDataConcourse = A(0)
                    For i As Integer = 0 To A.Length - 1
                        If A(i).GetStartTime < MinReconnaissanceDataConcourse.GetStartTime Then
                            MinReconnaissanceDataConcourse = A(i)
                        End If
                    Next
                    NewReconnaissanceDataConcourse = MinReconnaissanceDataConcourse.Clone
                    For i As Integer = 0 To A.Length - 1
                        Dim IsOk As Boolean = False

                        For j As Integer = 0 To A.Length - 1
                            If (A(j).GetStartTime - NewReconnaissanceDataConcourse.GetEndTime).TotalDays = 1 And (A(j).GetStartTime - NewReconnaissanceDataConcourse.GetEndTime).TotalDays > 0 Then '连接上一天的数据不应大于一天
                                ReDim Preserve NewReconnaissanceDataConcourse.ArrReconnaissance(NewReconnaissanceDataConcourse.ArrReconnaissance.Length + A(j).ArrReconnaissance.Length - 1)
                                For k As Integer = 0 To A(j).ArrReconnaissance.Length - 1
                                    NewReconnaissanceDataConcourse.ArrReconnaissance(NewReconnaissanceDataConcourse.ArrReconnaissance.Length - A(j).ArrReconnaissance.Length + k) = A(j).ArrReconnaissance(k).Clone
                                Next
                                IsOk = True
                                Exit For
                            End If
                        Next
                        If i = A.Length - 1 Then
                            IsOk = True
                        End If
                        If IsOk = False Then
                            MessageBox.Show("您选择的数据文件不是连续的，请检查您的数据文件!")
                            Exit Sub
                        End If
                    Next
                    Me.UpMetData.reconnaissance = NewReconnaissanceDataConcourse.Clone
                    Me.UpMetData.title.Longitude = "E"
                    Me.UpMetData.title.Latitude = "N"
                    Me.UpMetData.title.WeatherID = "99999"
                    Me.UpMetData.title.StartTime = Me.UpMetData.reconnaissance.GetStartTime.ToString
                    Me.UpMetData.title.EndTime = Me.UpMetData.reconnaissance.GetEndTime.ToString
                    ShowAllData()
                ElseIf OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.Length - 3, 3).ToUpper = "OQA" Then
                    MyObjectClear()
                    ClearTextBox()
                    Afile = OpenFileDialog1.FileName
                    OpenFileOQA(Afile)
                ElseIf OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.Length - 3, 3).ToUpper = "DAT" Then
                    Try
                        Dim rad As New RadiosondeData
                        Dim a As String = OpenFileDialog1.FileName
                        rad.mOnLine = False
                        rad.TranslateData(a)
                        Me.UpMetData.reconnaissance = Nothing
                        Me.UpMetData.reconnaissance = rad.ArrReconnaissance
                        Me.UpMetData.title = rad.RadiosTitle
                        Me.CheckStr = True
                        ShowAllData()
                    Catch ex As Exception
                        MsgBox("数据格式错误！")
                    End Try
                ElseIf OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.Length - 2, 2).ToUpper = "UA" Then
                    m_type = False
                    Me.UpMetData.Type = False
                    Me.UpMetData.OpenFile6201(OpenFileDialog1.FileName)
                    'Me.UpMetData.title.Latitude = FileUpperAirCommunication.UpperAirStations
                    'Dim aa As String = Me.UpMetData.title.Latitude
                    ShowAllData()
                End If
            End If
            SetLongtitude() '设置时区
        Catch ex As Exception
            MsgBox("数据文件格式错误！")
        End Try
        FlexParticularData.AutoSizeCols()
    End Sub
    ''' <summary>
    ''' 导入RAO格式文件
    ''' </summary>
    ''' <param name="mpath"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function LeadRaoDat(ByVal mpath As String) As Boolean
        Try
            Me.UpMetData.Type = True
            m_type = True
            m_reconnaissanceCount = 0

            OpenFileDialog1.Multiselect = True

            Dim Afile As String = ""
            Dim rad As New RadiosondeData
            rad.mOnLine = False
            rad.TranslateData(mpath)
            Me.UpMetData.reconnaissance = Nothing
            Me.UpMetData.reconnaissance = rad.ArrReconnaissance
            Me.UpMetData.title = rad.RadiosTitle
            Me.CheckStr = True
            ShowAllData()
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function
    Public mFileName As String = ""
    Private Sub btnSaveFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveFile.Click
 
        If CheckData() = True Then
            Dim saveFileDialog1 As New SaveFileDialog()
            ' saveFileDialog1.Filter = "AERMET高空气象观测数据文件(*.OQA)|*.OQA|AERMET高空气象观测数据文件FSL(*.DAT)|*.DAT"
            saveFileDialog1.Filter = "AERMET高空气象观测数据文件(*.OQA)|*.OQA|AERMET高空气象观测数据文件FSL(*.rao)|*.rao|高空气象观测数据文件TD6201(*.UA)|*.UA"
            saveFileDialog1.FilterIndex = 1
            saveFileDialog1.RestoreDirectory = True
            saveFileDialog1.InitialDirectory = Application.ExecutablePath
            saveFileDialog1.OverwritePrompt = True

            If saveFileDialog1.ShowDialog() = DialogResult.OK Then
                If saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3, 3).ToUpper = "RAO" Then
                    ExportFSLData(Me.UpMetData, saveFileDialog1.FileName)
                ElseIf saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 2, 2).ToUpper = "UA" Then
                    Me.m_UpMetData.ReturnTD6201(saveFileDialog1.FileName)
                Else
                    If Me.UpMetData.Type = True Then
                        Me.m_UpMetData.ExportData(saveFileDialog1.FileName)
                    Else
                        Me.m_UpMetData.ReturnOQA(saveFileDialog1.FileName)
                    End If

                End If
                mFileName = saveFileDialog1.FileName
            End If
        End If
    End Sub
   
    ''' <summary>
    ''' 导出FSL格式文件 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub ExportFSLData(ByVal mUpMetData As UpMetData, ByVal mPath As String)
        Dim mDataTime As String = ""
        'mDataTime = "    254" & mUpMetData
        Dim mMoonth() As String = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}
        Dim Lat As Double = mUpMetData.title.Latitude.Remove(mUpMetData.title.Latitude.Length - 1, 1) '取得纬度
        Dim Lon As Double = mUpMetData.title.Longitude.Remove(mUpMetData.title.Longitude.Length - 1, 1) '取得经度
        Dim mSunStr As String = ""
        Try
            For i As Integer = 0 To mUpMetData.reconnaissance.ArrReconnaissance.Length - 1

                ' mDataTime = "    254" & (mUpMetData.reconnaissance.ArrReconnaissance(i).Time - mUpMetData.title.TimeZone).ToString.PadLeft(7) & mUpMetData.reconnaissance.ArrReconnaissance(i).Day.PadLeft(7).ToString

                '时区转换，预留
                mUpMetData.reconnaissance.ArrReconnaissance(i).Time = mUpMetData.reconnaissance.ArrReconnaissance(i).Time - 8
                mDataTime = "    254" & (mUpMetData.reconnaissance.ArrReconnaissance(i).Time).ToString.PadLeft(7) & mUpMetData.reconnaissance.ArrReconnaissance(i).Day.PadLeft(7).ToString
                Dim mMoon As String = ""
                Select Case mUpMetData.reconnaissance.ArrReconnaissance(i).Month.Trim
                    Case "01"
                        mMoon = mMoonth(0)
                    Case "02"
                        mMoon = mMoonth(1)
                    Case "03"
                        mMoon = mMoonth(2)
                    Case "04"
                        mMoon = mMoonth(3)
                    Case "05"
                        mMoon = mMoonth(4)
                    Case "06"
                        mMoon = mMoonth(5)
                    Case "07"
                        mMoon = mMoonth(6)
                    Case "08"
                        mMoon = mMoonth(7)
                    Case "09"
                        mMoon = mMoonth(8)
                    Case "10"
                        mMoon = mMoonth(9)
                    Case "11"
                        mMoon = mMoonth(10)
                    Case "12"
                        mMoon = mMoonth(11)
                End Select
                mDataTime = mDataTime & mMoon.PadLeft(9).ToString
                mDataTime = mDataTime & mUpMetData.reconnaissance.ArrReconnaissance(i).Year.PadLeft(8).ToString & vbCrLf
                'Dim mLOLA As String = "      1" & "  9" & mUpMetData.title.WeatherID.Substring(2, 2) & mUpMetData.title.WeatherID.Substring(6, 2) & mUpMetData.title.WeatherID.Remove(1, 3).PadLeft(7) & (mUpMetData.title.Latitude.ToString).PadLeft(8) & (mUpMetData.title.Longitude.ToString).PadLeft(7) _
                '                        & mUpMetData.title.TerraHeight.ToString.PadLeft(6) & "  99999" & vbCrLf

                Dim id As String = ""
                If mUpMetData.title.WeatherID.Length <> 8 Then
                    id = mUpMetData.title.WeatherID
                Else
                    id = mUpMetData.title.WeatherID.Substring(3, 1) + mUpMetData.title.WeatherID.Substring(6, 2) + "99"
                End If


                Dim mLOLA As String = "      1" & id.PadLeft(7) + "  99999" & (mUpMetData.title.Latitude.ToString).PadLeft(8) & (mUpMetData.title.Longitude.ToString).PadLeft(7) _
                                      & mUpMetData.title.TerraHeight.ToString.PadLeft(6) & "   2303" & vbCrLf


                Dim mLays As String = "      2    500    500    500" & (mUpMetData.reconnaissance.ArrReconnaissance(i).TierCount + 4).ToString.PadLeft(7) & "  99999      3" & vbCrLf
                Dim mStation As String = "      3          HAHA                99999     ms" & vbCrLf ' _
                ' & "      9  99999  99999  99999  99999  99999  99999" & vbCrLf

                Dim mTop As String = mDataTime & mLOLA & mLays & mStation
                mSunStr = mSunStr & mTop
                Dim Str As String = ""
                For j As Integer = 0 To mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData.Length - 1
                    If j = 0 Then
                        Str = Str & "      9" & (mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).Pa).ToString.PadLeft(7)
                    Else

                        Str = Str & "      4" & (mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).Pa).ToString.PadLeft(7)
                    End If

                    If mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DistanceTerraHeight = -99999 Then
                        Str = Str & "99999".PadLeft(7)
                    Else
                        Str = Str & (mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DistanceTerraHeight + mUpMetData.title.TerraHeight).ToString.PadLeft(7)
                    End If
                    If mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DryTemperature = -9990 Then
                        Str = Str & "99999".PadLeft(7)
                    Else
                        Str = Str & mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DryTemperature.PadLeft(7)
                    End If
                    If mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DewPointTemperature = -9990 Then
                        Str = Str & "99999".PadLeft(7)
                    Else
                        Str = Str & mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).DewPointTemperature.PadLeft(7)
                    End If
                    If mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).WindVane = 999 Then
                        Str = Str & "99999".PadLeft(7)
                    Else
                        Str = Str & mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).WindVane.PadLeft(7)
                    End If
                    If mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).WindSpeed = 9990 Then
                        Str = Str & "99999".PadLeft(7)
                    Else
                        Str = Str & mUpMetData.reconnaissance.ArrReconnaissance(i).ArrtierData(j).WindSpeed.PadLeft(7)
                    End If
                    Str = Str & vbCrLf
                Next
                mSunStr = mSunStr & Str
            Next
            FileOpen(1, mPath, OpenMode.Output)
            PrintLine(1, mSunStr)
            FileClose(1)
        Catch ex As Exception
            MsgBox("写文件出错,请改名称重试", MsgBoxStyle.OkOnly, "提示")
        End Try

    End Sub


    Public Function CheckData() As Boolean
        Dim null As String = "null"
        Dim btnDate As String = ""


        If txtLatitude.Text = Nothing Or txtLatitude.Text.Trim() = "" Then
            MessageBox.Show("纬度不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        End If
        If txtLongitude.Text = Nothing Or txtLongitude.Text.Trim() = "" Then
            MessageBox.Show("经度不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        End If

        If txtTimeZone.Text = Nothing Or txtLongitude.Text.Trim() = "" Then
            MessageBox.Show("时区不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        End If
        If txtWeatherID.Text = Nothing Or txtLongitude.Text.Trim() = "" Then
            MessageBox.Show("站台号不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)

            Return False
        End If
        Me.m_UpMetData.title.WeatherID = Me.txtWeatherID.Text
        'If txtTerraHeight.Text = Nothing Or txtLongitude.Text.Trim() = "" Then
        '    MessageBox.Show("地面高程数据不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        '    Return False
        'End If
        If Me.UpMetData.Type = True Then
            If txtTerraHeight.Text = Nothing Or txtLongitude.Text.Trim() = "" Then
                MessageBox.Show("地面高程数据不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Return False
            End If
        End If
      



        For i As Integer = 0 To Me.FlexTimeTier.Rows.Count - 1 - 1
            Dim a As String = "第" & i + 1 & "行层数不能为0，必须大于等于一层"
            Dim c As String = Me.FlexTimeTier.GetData(i + 1, 3)
            If CInt(Me.FlexTimeTier.GetData(i + 1, 3)) = 0 Then
                MessageBox.Show(a, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Return False
            End If
        Next

        If StringHandle.m_openFile <> 1 Then
            MessageBox.Show("不能保存，还没有设置数据，请打开文件，或设置数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return False
        End If

        Return True
    End Function

    Private Sub btnSetTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetTime.Click
        Dim frm As New frmSetupReconnaissance
        If StringHandle.m_default = True Then
            Dim dateone As String = ""
            Dim datetwo As String = ""
            Dim lastdate As String = ""
            frm.m_reconnaissance = Me.m_UpMetData.reconnaissance

            StringHandle.m_start = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Day)
            StringHandle.m_end = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Day)

        Else
            StringHandle.m_start = New DateTime(2008, 1, 1)
            StringHandle.m_end = New DateTime(2008, 12, 31)
        End If

        Dim count As Integer = 0
        If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Dim riqi As String = ""
            Me.m_UpMetData.reconnaissance = frm.m_reconnaissance
            Me.FlexTimeTier.Rows.Count = frm.m_reconnaissance.ArrReconnaissance.Length + 1 'Me.m_UpMetData.reconnaissance.ArrReconDate.Length + 1

            'Me.FlexParticularData.RowSel = 1


            For i As Integer = 0 To frm.m_reconnaissance.ArrReconnaissance.Length - 1
                FlexTimeTier.SetData(i + 1, 0, i + 1)
                riqi = Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).Year & "-" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).Month & "-" & Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).Day
                FlexTimeTier.SetData(i + 1, 1, riqi)
                Me.FlexTimeTier.SetData(i + 1, 2, Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).Time)
                Me.FlexTimeTier.SetData(i + 1, 3, Me.m_UpMetData.reconnaissance.ArrReconnaissance(i).TierCount)
            Next




            Me.ShowFlexTimeTier()
            '  DisplayFlex()

            Me.Start_time_p.Text = StringHandle.m_start.Year & "年" & StringHandle.m_start.Month & "月" & StringHandle.m_start.Day & "日"
            Me.End_time_p.Text = StringHandle.m_end.Year & "年" & StringHandle.m_end.Month & "月" & StringHandle.m_end.Day & "日"
        End If
    End Sub

    Private Sub txtLongitude_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtLongitude.Validating
        Try
            If Me.txtLongitude.Text.Trim() = "" Then
                Exit Sub
            ElseIf CDbl(Me.txtLongitude.Text) < 1 Then

            End If

        Catch ex As Exception
            Me.txtLongitude.Text = ""
            MessageBox.Show("请正确输入，数字！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End Try
        Me.m_UpMetData.title.Longitude = Me.txtLongitude.Text & Me.cobJd.Text
        SetLongtitude() '设置时区
    End Sub
    ''' <summary>
    ''' 根据经度求时区
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub SetLongtitude()
        Try
            If Me.cobJd.Text = "E" Or Me.cobJd.Text = "e" Then
                txtTimeZone.Text = -Math.Round(Me.txtLongitude.Text / 15)
            Else
                txtTimeZone.Text = Math.Round(Me.txtLongitude.Text / 15)
            End If
            Me.m_UpMetData.title.TimeZone = CDbl(Me.txtTimeZone.Text)
        Catch ex As Exception

        End Try

    End Sub

    Private Sub txtLatitude_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtLatitude.Validating
        Try
            If Me.txtLatitude.Text.Trim() = "" Then

                Exit Sub
            ElseIf CDbl(Me.txtLatitude.Text) < 1 Then

            End If

        Catch ex As Exception
            Me.txtLatitude.Text = ""
            MessageBox.Show("请正确输入，数字！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End Try
        Me.m_UpMetData.title.Latitude = Me.txtLatitude.Text & Me.cobWd.Text
    End Sub

    Private Sub cobJd_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cobJd.Validating
        Me.m_UpMetData.title.Longitude = Me.txtLongitude.Text & Me.cobJd.Text
    End Sub

    Private Sub cobWd_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cobWd.Validating
        Me.m_UpMetData.title.Latitude = Me.txtLatitude.Text & Me.cobWd.Text
    End Sub
    Private Sub MyObjectClear()
        ReDim Preserve Me.UpMetData.reconnaissance.ArrReconnaissance(-1)
        ' m_reconnaissance.ArrReconnaissance(p) = New ReconnaissanceData
        Me.txtLatitude.Text = ""
        Me.txtLongitude.Text = ""
        Me.FlexTimeTier.Rows.Count = 1
        Me.FlexParticularData.Rows.Count = 1
        Me.Start_time_p.Text = ""
        Me.End_time_p.Text = ""
    End Sub
    Private Sub OpenTXT()
        Me.m_UpMetData.title.Latitude = "0.0E"
        Me.m_UpMetData.title.Longitude = "0.0S"
        Me.m_UpMetData.title.WeatherID = "abc"
    End Sub
    Private Sub CloseTXT()
        If Me.m_UpMetData.title.WeatherID = "abc" Then
            Me.txtLatitude.Text = ""
            Me.txtLongitude.Text = ""
            Me.cobJd.Text = ""
            Me.cobWd.Text = ""
            Me.txtLatitude.Enabled = False
            Me.txtLongitude.Enabled = False
            Me.cobJd.Enabled = False
            Me.cobWd.Enabled = False
        Else
            Me.txtLatitude.Enabled = True
            Me.txtLongitude.Enabled = True
            Me.cobJd.Enabled = True
            Me.cobWd.Enabled = True
        End If
    End Sub

    'Private Sub btnConstrue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConstrue.Click
    '    Dim frm As New frmReconnaConstrue
    '    frm.m_reconnaissance = Me.m_UpMetData.reconnaissance
    '    frm.Show()

    'End Sub

    Private Sub txtWeatherID_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtWeatherID.Validating
        Try
            If Me.txtWeatherID.Text.Trim() = "" Then

                Exit Sub
            ElseIf CDbl(Me.txtWeatherID.Text) < 1 Then

            End If

        Catch ex As Exception
            Me.txtWeatherID.Text = ""
            MessageBox.Show("请正确输入，数字！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End Try
        Me.m_UpMetData.title.WeatherID = Me.txtWeatherID.Text
    End Sub

    Private Sub txtTimeZone_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTimeZone.Validating
        Try
            If Me.txtTimeZone.Text.Trim() = "" Then

                Exit Sub
            ElseIf CDbl(Me.txtTimeZone.Text) < 1 Then

            End If

        Catch ex As Exception
            Me.txtTimeZone.Text = ""
            MessageBox.Show("请正确输入，数字！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End Try
        Me.m_UpMetData.title.TimeZone = CDbl(Me.txtTimeZone.Text)
    End Sub

    Private Sub txtTerraHeight_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTerraHeight.Validating
        Try
            If Me.txtTerraHeight.Text.Trim() = "" Then

                Exit Sub
            ElseIf CDbl(Me.txtTerraHeight.Text) < 1 Then

            End If

        Catch ex As Exception
            Me.txtTerraHeight.Text = ""
            MessageBox.Show("请正确输入，数字！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End Try
        Me.m_UpMetData.title.TerraHeight = CDbl(Me.txtTerraHeight.Text)
    End Sub
    ''' <summary>
    ''' 清空 窗体的  TextBox 的值，以及标题类的 数据
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub ClearTextBox()
        Me.txtLatitude.Text = ""
        Me.txtLongitude.Text = ""
        Me.txtTimeZone.Text = ""
        Me.txtWeatherID.Text = ""
        Me.txtTerraHeight.Text = ""
        Me.m_UpMetData.title.Latitude = ""
        Me.m_UpMetData.title.Longitude = ""
        Me.m_UpMetData.title.WeatherID = ""
        Me.m_UpMetData.title.TimeZone = Nothing
        Me.m_UpMetData.title.TerraHeight = Nothing
    End Sub

    Private Sub btnConstrue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConstrue.Click
        Dim frm As New frmReconnaConstrue
        frm.ReconnaissanceDataConcourse = Me.m_UpMetData.reconnaissance
        frm.Show()
        'If frm.ShowDialog = Windows.Forms.DialogResult.OK Then

        'End If


    End Sub

    Private Sub cmd_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_OK.Click
        If CheckData() = True Then
            Me.DialogResult = Windows.Forms.DialogResult.OK
            Me.Close()
        End If
    End Sub

    Private Sub txtLongitude_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLongitude.TextChanged

    End Sub

    Private Sub txtTimeZone_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtTimeZone.TextChanged

    End Sub

    Private Sub FlexTimeTier_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlexTimeTier.DoubleClick
        Dim frm As New frmTeechart
        If Me.UpMetData.Type = True Then
            frm.type = True
            frm.ReconnaissanceData = Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.FlexTimeTier.RowSel - 1)
        Else
            frm.type = False
            frm.StructureUpAir = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.FlexTimeTier.RowSel - 1)
        End If
        frm.ShowDialog()
    End Sub

    '小李
    '2010-10-8
    '自动导入FSl文件
    Public Function AutoOpenFSL(ByVal filename As String) As Boolean
        'Try
        '    Me.UpMetData.Type = True
        '    m_type = True
        '    m_reconnaissanceCount = 0

        '    OpenFileDialog1.Multiselect = True

        '    Me.m_TitleChange = 0
        '    Me.FlexTimeTier.Rows.Count = 1
        '    Me.FlexParticularData.Rows.Count = 1


        '    Try
        '        Dim rad As New RadiosondeData
        '        Dim a As String = filename
        '        rad.mOnLine = False
        '        '对网上提供的数据的转换，探空NOAA/ESRL 数据
        '        rad.TranslateData(a)

        '        Me.UpMetData.reconnaissance = Nothing
        '        Me.UpMetData.reconnaissance = rad.ArrReconnaissance
        '        Me.UpMetData.title = rad.RadiosTitle
        '        Me.CheckStr = True

        '        '显示FSL格式文件
        '        ShowFSLData()

        '    Catch ex As Exception
        '        MsgBox("数据格式错误！")
        Return False
        '    End Try
        'Catch ex As Exception
        '    MsgBox("数据文件格式错误！")
        '    Return False
        'End Try

        'FlexParticularData.AutoSizeCols()

    End Function
    '小李
    '2010-10-8
    '显示FSL格式文件

    'Public Sub ShowFSLData()
    '    If Me.UpMetData.Type = True Then ' m_type = True Then

    '        If Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length > 0 Then
    '            Me.Start_time_p.Text = Me.m_UpMetData.title.StartTime
    '            Me.End_time_p.Text = Me.m_UpMetData.title.EndTime
    '            If Me.m_UpMetData.title.Longitude IsNot Nothing AndAlso Me.m_UpMetData.title.Longitude <> "" Then
    '                Me.txtLongitude.Text = Me.m_UpMetData.title.Longitude.Remove(Me.m_UpMetData.title.Longitude.Length - 1)
    '            End If
    '            If Me.m_UpMetData.title.Longitude.EndsWith("e") Or Me.m_UpMetData.title.Longitude.EndsWith("E") Then
    '                cobJd.Text = "E"
    '            Else
    '                cobJd.Text = "W"
    '            End If

    '            If Me.m_UpMetData.title.Latitude.EndsWith("N") Or Me.m_UpMetData.title.Latitude.EndsWith("n") Then
    '                cobWd.Text = "N"
    '            Else
    '                cobWd.Text = "S"
    '            End If
    '            If Me.m_UpMetData.title.Latitude IsNot Nothing AndAlso Me.m_UpMetData.title.Latitude <> "" Then
    '                Me.txtLatitude.Text = Me.m_UpMetData.title.Latitude.Remove(Me.m_UpMetData.title.Latitude.Length - 1)
    '            End If

    '            Me.txtWeatherID.Text = Me.m_UpMetData.title.WeatherID
    '            Me.txtTimeZone.Text = Me.m_UpMetData.title.TimeZone
    '            Me.txtTerraHeight.Enabled = True
    '            Me.txtTerraHeight.Text = Me.m_UpMetData.title.TerraHeight
    '            StringHandle.m_openFile = 1
    '            StringHandle.m_boolTaxis = True
    '            StringHandle.m_default = True
    '            Start_time_p.Text = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(0).Day)
    '            End_time_p.Text = New Date(Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Year, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Month, Me.m_UpMetData.reconnaissance.ArrReconnaissance(Me.m_UpMetData.reconnaissance.ArrReconnaissance.Length - 1).Day)

    '            ShowFlexTimeTier()
    '        End If


    '    Else
    '        If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length > 0 Then
    '            Me.Start_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime
    '            Me.End_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime
    '            'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).Longitude <> 0 Then
    '            '    Me.txtLongitude.Text = Me.FileUpperAirCommunication.ArrStructureUpAir(0).Longitude
    '            'End If

    '            Me.txtLongitude.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.Longitude
    '            cobJd.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.LongitudeCode
    '            'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).LongitudeCode.EndsWith("e") Or Me.FileUpperAirCommunication.ArrStructureUpAir(0).LongitudeCode.EndsWith("E") Then
    '            '    cobJd.Text = "E"
    '            'Else
    '            '    cobJd.Text = "W"
    '            'End If
    '            cobWd.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.LatitudeCode
    '            'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).LatitudeCode.EndsWith("N") Or Me.FileUpperAirCommunication.ArrStructureUpAir(0).LatitudeCode.EndsWith("n") Then
    '            '    cobWd.Text = "N"
    '            'Else
    '            '    cobWd.Text = "S"
    '            'End If
    '            Me.txtLatitude.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.Latitude
    '            'If Me.FileUpperAirCommunication.ArrStructureUpAir(0).Latitude <> 0 Then
    '            '    Me.txtLatitude.Text = Me.FileUpperAirCommunication.ArrStructureUpAir(0).Latitude
    '            'End If

    '            Me.txtWeatherID.Text = Me.m_UpMetData.FileUpperAirCommunication.UpperAirStations.StationID
    '            'Me.txtTimeZone.Text = Me.m_UpMetData.title.TimeZone
    '            'Me.txtTerraHeight.Text = Me.m_UpMetData.title.TerraHeight
    '            Me.txtTerraHeight.Text = ""
    '            Me.txtTerraHeight.Enabled = False
    '            StringHandle.m_openFile = 1
    '            StringHandle.m_boolTaxis = True
    '            StringHandle.m_default = True
    '            Start_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(0).MyDateTime.Day & "日"
    '            End_time_p.Text = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1).MyDateTime.Day & "日"

    '            'ShowUa()数据显示到表格 开始

    '            Me.FlexParticularData.Rows.Count = 1
    '            Me.FlexParticularData.Cols(3).Caption = "海拔高度" & vbCrLf & "[m]"
    '            Me.FlexParticularData.SetData(0, 5, "相对湿度" & vbCrLf & "[°C]")
    '            Me.FlexTimeTier.Rows.Count = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length + 1
    '            '    Me.FlexParticularData.Rows.Count = Me.FileUpperAirCommunication.ArrStructureUpAir(0).ArrStructureUpAirTierData.Length + 1
    '            Dim Index As Integer = 0


    '            For f1 As Integer = 0 To Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir.Length - 1
    '                Me.FlexTimeTier.SetData(f1 + 1, 0, f1 + 1)




    '                Me.FlexTimeTier.SetData(f1 + 1, 1, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Year & "年" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Month & "月" & Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Day & "日")

    '                Me.FlexTimeTier.SetData(f1 + 1, 2, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).MyDateTime.Hour)


    '                If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).TierCount = Nothing Then
    '                    Me.FlexTimeTier.SetData(f1 + 1, 3, "")

    '                Else
    '                    Me.FlexTimeTier.SetData(f1 + 1, 3, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(f1).TierCount)

    '                End If


    '                Me.FlexTimeTier.SetData(f1 + 1, 4, "查看")

    '            Next



    '            If m_TitleChange > 0 Then

    '                Index = Me.m_TitleChange - 1
    '            Else
    '                Index = 0
    '            End If
    '            If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).TierCount > 0 Then
    '                Me.FlexParticularData.Rows.Count = Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData.Length + 1
    '                For f2 As Integer = 0 To Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData.Length - 1


    '                    Me.FlexParticularData.SetData(f2 + 1, 0, f2 + 1)
    '                    Me.FlexParticularData.SetData(f2 + 1, 1, f2 + 1)
    '                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure = 99999 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 2, "")

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure <> 99999 Then

    '                        Me.FlexParticularData.SetData(f2 + 1, 2, UnitsTranslate.MZ_FormatPa(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure))

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Airpressure = Nothing Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 2, "")


    '                    End If


    '                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height = -99999 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 3, "")

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height <> -99999 Then

    '                        Me.FlexParticularData.SetData(f2 + 1, 3, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height)


    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Height = Nothing Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 3, "")



    '                    End If


    '                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature = -9990 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 4, "")

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature <> -9990 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 4, UnitsTranslate.M_FormatDryTemperature(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature))


    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).AirTemperature = Nothing Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 4, "")

    '                    End If



    '                    Me.FlexParticularData.SetData(f2 + 1, 5, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).Humidity)




    '                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane = 999 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 6, "")

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane <> 999 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 6, Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane)

    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindVane = Nothing Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 6, "")


    '                    End If


    '                    If Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed = 9990 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 7, "")

    '                    ElseIf UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed) <> 9990 Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 7, UnitsTranslate.M_FormatWindSpeed(Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed) * 10)


    '                    ElseIf Me.m_UpMetData.FileUpperAirCommunication.ArrStructureUpAir(Index).ArrStructureUpAirTierData(f2).WindSpeed = Nothing Then
    '                        Me.FlexParticularData.SetData(f2 + 1, 7, "")

    '                    End If
    '                Next
    '            End If



    '            Me.FlexTimeTier.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
    '            Me.FlexTimeTier.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
    '            Me.FlexTimeTier.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
    '            Me.FlexTimeTier.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None

    '            Me.FlexParticularData.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
    '            Me.FlexParticularData.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None
    '            Me.FlexParticularData.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.None
    '            Me.FlexParticularData.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None
    '            'ShowUa()数据显示到表格 结束

    '        End If
    '    End If
    '    SetLongtitude() '计算时区
    'End Sub

    Private Sub CText1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTimeModify.Validating
        Me.m_UpMetData.title.TimeModify = txtTimeModify.Value
    End Sub
End Class